#define OK 1


int malloc_SLL(StaticLinkList space);
int malloc_SLL(StaticLinkList space)
{
    int i = space[0].cur;
    if (space[0].cur)
    {
       space[0].cur = space[i].cur;//插入一个数据        
    }
       return i;
}	
		
		  
Status InitList(StaticLinkList space)  //静态链表
{
    int i;
    for ( i =0,i < MAXSIZE-1;i++)
    {
        space[i].cur = i+1;       
    }   	    

        space[MAXSIZE-1].cur = 0; 
    return OK;    
}

Status ListInsert (StaticLinkList L, int i,ElemType e)
{
      int j,k,l;
      k = MAXSIZE -1;
      if (i <1 || i > ListLength(L)+1)  
      {
          return ERROR;
      }

j = malloc_SLL(L);

      if (j)
      {
          L[j].data = e;
          for (l =1;l <= i-1;l++)  
          {
	      k = L[k].cur;
	  } 
          L[j].cur = L[k].cur;
	  L[k].cur = j;
      } 
         return OK;

}
	
